const app = getApp()

Page({
  data: {
    orderItem: {},
    orderRefundsList: {},
    picUrls: []
  },
  onShow() {

  },
  onLoad(options) {
    this.setData({
      orderItemId: options.orderItemId
    })
    app.initPage()
      .then(res => {
        this.orderItemGet(this.data.orderItemId)
      })
  },
  orderItemGet(id) {
    let that = this
    app.api.orderItemGet(id)
      .then(res => {
        let orderItem = res.data
        this.setData({
          orderItem: orderItem,
          orderRefundsList: orderItem.listOrderRefunds
        })
      })
  },
  ViewImage(e) {
    wx.previewImage({
      urls: this.data.orderRefundsList[0].picUrls,
      current: e.currentTarget.dataset.url
    });
  },
  handleContact() {
    wx.makePhoneCall({
      phoneNumber: '4008888888'
    })
  },
})